package zhiquan.cai.DateTime;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.Month;

public class DateTime {
    public static void main(String[] args) {
        // 获取当前的日期时间
        LocalDateTime currentTime = LocalDateTime.now();
        System.out.println("当前时间: " + currentTime);

        LocalDate date = currentTime.toLocalDate();
        System.out.println("date: " + date);

        Month month = currentTime.getMonth();
        int day = currentTime.getDayOfMonth();
        int seconds = currentTime.getSecond();

        System.out.println("月: " + month +", 日: " + day +", 秒: " + seconds);
    }
}
